#ifndef STATISTICS_PERSPECTIVE_H
#define STATISTICS_PERSPECTIVE_H

#include <editorarea.h>
#include <iperspective.h>

#include <QtGui/QMainWindow>

namespace swp
{
class PerspectiveManager;
class ReportNavigator;

class StatisticsPerspective : public QMainWindow, public core::IPerspective
{
    Q_OBJECT

public:
    StatisticsPerspective(PerspectiveManager* manager = 0,
        QWidget* parent = 0);
    ~StatisticsPerspective();

    // IPerspective
    QList<QAction* > getStaticActions(const QString& menuId) const;
    QList<QAction* > getContextActions(const QString& menuId) const;
    QList<QToolBar* > getStaticToolBars() const;
    QList<QToolBar* > getContextToolBars() const;

    QList<QAction* > getPerspectiveEnsuringActions() const;

    core::IEditorArea* getEditorArea() const;

    bool canOpen(const core::MimeType& type) const;

    void handleIsCurrentChanged(bool current);

    void readSettings(QSettings* settings);
    void writeSettings(QSettings* settings) const;

private:
    void createCentralWidget();
    void createDockWidgets();
    void createActions();
    void createToolBars();
    void connectSlots();

private slots:
    void handleEditorChange(const QSharedPointer<core::IEditor>& editor);
    void highlightDocument(const QSharedPointer<core::IDocument>& document);
    void exportReport();

private:
    PerspectiveManager* m_manager;

    QDockWidget* m_reportNavigatorDock;
    ReportNavigator* m_reportNavigator;

    gui::EditorArea* m_editorArea;

    QToolBar* m_exportToolBar;

    QAction* m_viewSeparator;
    QAction* m_exportAction;
};

} // namespace swp

#endif
